<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2024/4/2
 * Time: 11:37
 */

namespace plugin\admin\app\controller\admin;


use plugin\admin\app\controller\AuthController;
use plugin\admin\app\logic\admin\AdminLogic;
use plugin\admin\app\logic\admin\RuleLogic;
use plugin\admin\app\model\Option;
use support\Request;
use support\Response;

class IndexController extends AuthController
{
    /**
     * 获取配置 基于配置文件获取默认权限
     * @return Response
     */
    public function getConfig(Request $request): Response
    {
        return AdminLogic::getInstance()->getConfig();
    }

    /**
     * 获取菜单
     * @param Request $request
     * @return Response
     */
    function getRuleMenu(Request $request): Response
    {
        return AdminLogic::getInstance()->getRuleMenu($request);

    }

    /**
     * 获取登录信息
     * @param Request $request
     * @return Response
     */
    public function getInfo(Request $request): Response
    {
        return AdminLogic::getInstance()->getInfo($request);
    }

    /**
     * 获取权限
     * @param Request $request
     * @return Response
     */
    public function permission(Request $request): Response
    {
        return RuleLogic::getInstance()->permission($request);
    }
}